package main

import "fmt"

type Patient struct {
	id   int
	name string
	age  int
}

func (obj Patient) toString()  {
	fmt.Printf("Patient: id=%d, name=%s, age=%d \n", obj.id, obj.name, obj.age)
}

func (obj *Patient) getPatientName() string {
	return obj.name
}

type Patient1 struct {
	Patient
}

type Patient2 struct {
	*Patient
}

func main() {
	//patient := Patient{1, "zs", 10}
	patient := Patient{name: "zss",age: 10}
	patient1 := Patient1{patient}
	patient2 := Patient2{&patient}
	patient1.age = 11
	fmt.Println(patient)
	fmt.Println(patient1)
	fmt.Println(patient2)
	patient.toString()
	patient1.toString()
	patient2.toString()
	patient2.age = 12
	fmt.Println(patient)
	fmt.Println(patient1)
	fmt.Println(patient2)
	patient.toString()
	patient1.toString()
	patient2.toString()
	//fmt.Println(patient2.getPatientName())
}
